package com.xy;

import com.xy.decorate.Chocolate;
import com.xy.decorate.Decorator;
import com.xy.decorate.Milk;
import com.xy.decorate.Soy;
import com.xy.drink.Drink;
import com.xy.drink.LongBlack;

/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/6/12 11:51
 * @description
 */
public class CoffeeBar {
    public static void main(String[] args) {
        // 点一份咖啡
        Drink order = new LongBlack();
        System.out.println(order.cost() + "$\t" + order.getDes());

        // 加一份牛奶
        order = new Milk(order);
        System.out.println(order.cost() + "$\t" + order.getDes());

        // 加两份巧克力
        order = new Chocolate(order);
        System.out.println(order.cost() + "$\t" + order.getDes());
        order = new Chocolate(order);
        System.out.println(order.cost() + "$\t" + order.getDes());
    }
}
